package com.leancloud.circle.adapter;

import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.leancloud.circle.R;
import com.leancloud.circle.bean.CommentBean;

import tech.com.commoncore.manager.GlideManager;

public class CircleCommentAdapter extends BaseQuickAdapter<CommentBean, BaseViewHolder> {

    public CircleCommentAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, CommentBean item) {
        String nike = item.getUser().getUser_nickname();
        String headUrl = item.getUser().getAvatar();

        String date = item.getCreate_time();
        String content = item.getContent();

        ImageView headView = helper.itemView.findViewById(R.id.comment_item_user_head_img);
        GlideManager.loadRoundImg(headUrl, headView, R.mipmap.circle_icon_default_head);

        helper.setText(R.id.comment_item_user_name_tx, nike)
                .setText(R.id.comment_item_date_tx, date)
                .setText(R.id.comment_item_content_tx, content);
    }
}
